package com.mind.customer.controller;

import com.mind.common.utils.file.vo.FileVo;
import com.mind.common.core.domain.AjaxResult;
import com.mind.customer.api.ocr.OCRUtils;
import com.mind.customer.domain.ContentMap;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import jakarta.annotation.Resource;
import java.io.IOException;

@RestController
@RequestMapping("model")
public class ModelController {
    @Resource
    private OCRUtils ocrUtils;
    @PostMapping("getContentPI")
    public AjaxResult getContentPI(@RequestBody ContentMap params) throws IOException {
        return AjaxResult.success(ocrUtils.getContent(new FileVo(params.getValue()), params.getFields(), null));
    }
}
